<?php
global $_SYS;
global $cache_settings;
global $cache_template;
global $cache_groups;
global $cache_forums;
global $lg;
global $tid;
global $fid;
global $db;
$tid=empty($tid)?numFilter($_GET['tid']):$tid;
$fid=empty($fid)?numFilter($_GET['fid']):$fid;
$headtitle="操作提示";
$msgstr="";
$msglink1="<img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /> <a href=\"javascript:history.go(-1)\"><u>返回继续操作</u></a>";
$msglink2="<img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /> <a href=\"{$_SYS['indexurl']}\"><u>返回首页</u></a>";
$msglink3="<img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /> <a href='".genUrl("forum.php?fid={$fid}")."'><u>返回帖子列表</u></a>";
$msglink4="<img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /> <a href='".genUrl("view.php?tid={$tid}")."'><u>返回查看的帖子</u></a>";
$msglink5="<img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /> <a href='".genUrl("view.php?tid={$tid}")."'><u>{text}</u></a>";

switch($msg_code){
	case "announce_noexist":
		$msgstr="您查看的公告不存在。";
		$msglink = $msglink2;
	break;
	
	case "announce_outdate":
		$msgstr="您查看的公告已经过期。";
		$msglink = $msglink2;
	break;
	
	case "attach_referer_err":
		$msgstr="您的访问来源有错误，或者该附件被盗链。";
		$msglink = $msglink2;
	break;	
	
	case "attach_notexist":
		$msgstr="您访问的附件已经不存在。";
		$msglink = $msglink2;
	break;
	
	case "attach_login":
		$msgstr="您还没有登录，没有权限访问该附件。";
		$msglink = "<a href='login.php?ref=".urlencode($_SERVER["REQUEST_URI"])."'><u>点击立即登录</u> <img src=\"images/ico_go.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";
	break;
	
	case "forum_forumusers":
		$msgstr="本版块只有特定的用户才能访问。";
		$msglink = $msglink1;
	break;
	
	case "forum_forumgroups":
		$msgstr="您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限访问该版块。";
		$msglink = $msglink1;
	break;
		
	case "forum_forumpass":
		$msgstr="<form action='".genUrl("forum.php?fid={$fid}")."' method='POST'>请输入版块的访问密码: <input type='password' size='20' name='forumpass' class='text_css' /> <input type='submit' class='button_css' value='提交' /></form>";
	break;

	case "forum_adminpass":
		$msgstr="<form action='admin.php?fid={$fid}' method='POST'>要进入管理面板，请先输入您的登录密码:<br /> <input type='password' size='20' name='userpass' class='text_css' /> <input type='submit' class='button_css' value='提交' /></form>";
	break;

	case "login_detailsrequired":
		$msgstr="请填写完整用户名和密码。";
		$msglink = $msglink1;		
	break;
	
	case "login_namepasserr":
		$msgstr="您的用户名或密码错误，请检查后重试。";
		$msglink = $msglink1;				
	break;
	
	case "login_validationcodeerr":
		$msgstr="您输入的验证码错误，请检查后重试。";
		$msglink = $msglink1;		
	break;

	case "login_succeed":
		$ref = empty($_POST['ref'])?"index.php":$_POST['ref'];
		$msgstr="登录成功，请等待自动跳转。<script>setTimeout(function(){window.location.href=\"{$ref}\";},2000);</script>";
		$msglink = "<a href='{$ref}'><u>点击返回登录前页面</u> <img src=\"images/ico_go.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";
	break;

	case "login_group".GROUP_NOVERIFY:
		if($cache_settings['issignupverify']=='2'){
			$msgstr="请您先通过系统发出的激活邮件的链接激活该帐号。<br />如果您没有收到激活邮件，请点击下面的发送激活邮件链接。";
			$msglink = "<a href='public.php?action=getactive'><u>发送激活邮件</u> <img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";	
		}else{
			$msgstr="该用户还没有通过审核，暂时不能使用。";
			$msglink = $msglink2;
		}
	break;

	case "login_group".GROUP_NOVISIT:
		$msgstr="该用户已经被禁止访问。";
	break;
	
	case "login_group".GROUP_VERIFYFAILED:
		$msgstr="该用户验证不通过。";
	break;
	
	case "login_nogroup":
		$msgstr="对不起，您的所属用户组不存在。请与管理员联系。";
		$msglink = $msglink2;
	break;	
	
	case "logout_succeed":
		$msgstr="您已经安全退出登录。";
		$msglink = $msglink2;
	break;	
	
	case "online_max":
		$msgstr="对不起，当前论坛在线人数已经达到最大限制，请稍后访问。";
		$msglink = "";			
	break;

	case "popedom_0":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})被禁止访问论坛。";
	break;

	case "popedom_1":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限浏览帖子。";
		$msglink = $msglink1;	
	break;

	case "popedom_2":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限浏览其他用户的资料。";
		$msglink = $msglink2;	
	break;

	case "popedom_4":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限使用论坛搜索功能。";
		$msglink = $msglink2;	
	break;

	case "popedom_6":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限发布投票。";
		$msglink = $msglink3;	
	break;

	case "popedom_7":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限发布悬赏。";
		$msglink = $msglink3;	
	break;

	case "popedom_9":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限发布新话题。";
		$msglink = $msglink3;	
	break;

	case "popedom_10":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限回复帖子。";
		$msglink = $msglink4;	
	break;

	case "popedom_13":
		$msgstr="对不起，您所在的用户组({$cache_groups[$lg['groupid']]['groupname']})没有权限查看/下载附件。";
		$msglink = $msglink2;	
	break;

	case "post_frozentime":
		$msgstr="对不起，新注册会员需要{$cache_settings['frozentime']}小时之后才能发帖。";
		$msglink = $msglink3;
	break;
	
	case "post_postitime":
		$msgstr="对不起，论坛限制两次发帖时间间隔为{$cache_settings['postitime']}秒。";
		$msglink = $msglink3;	
	break;
	
	case "post_validationcodeerr":
		$msgstr="您输入的验证码错误，请检查后重试。";
		$msglink = $msglink1;	
	break;

	case "post_failed_dirty":
		$msgstr="帖子含有非法关键字，禁止发布。";
		$msglink = $msglink1;	
	break;
	
	case "post_voteitemrequired":
		$msgstr="您没有填写投票项目，请检查后重试。";
		$msglink = $msglink1;	
	break;
	
	case "post_voteitemtoomuch":
		$msgstr="您的投票项目超过10个，请检查后重试。";
		$msglink = $msglink1;	
	break;
	
	case "post_votetimeerr":
		$msgstr="您输入投票时间的时间有错误，请检查后重试。";
		$msglink = $msglink1;
	break;
	
	case "post_creditserr":	//积分代码有错误
		$msgstr="悬赏的积分类型错误，请检查后重试。";
		$msglink = $msglink1;
	break;
	
	case "post_rewarderr":	//积分数量有错误
		$msgstr="悬赏的数值不能小于1，并且不能超过您拥有的数值，请检查后重试。";
		$msglink = $msglink1;
	break;
	
	case "post_succeed_dirty":
		$msgstr="您的帖子已经发布。帖子中含有禁用的关键字，请等待管理员审核。";
		$msglink = $msglink3;
	break;
	
	case "search_searchitime":
		$msgstr="两次搜索的时间间隔不能少于{$cache_settings['postitime']}秒，请稍后再试。";
		$msglink = $msglink1;
	break;

	
	case "search_nokeyword":
		$msgstr="搜索的关键字不能为空，请检查后重试。";
		$msglink = $msglink1;
	break;

	
	case "signup_signupoff":
		$msgstr="对不起，论坛不开放会员注册功能。";
		$msglink = $msglink2;
	break;

	
	case "signup_signupitime":
		$msgstr="对不起，同一个IP的注册间隔时间不能小于{$cache_settings['signupitime']}小时。";
		$msglink = $msglink2;
	break;
	
	case "signup_required":
		$msgstr="请输入完整的注册资料。";
		$msglink = $msglink1;
	break;
	
	case "signup_succeed_0":
		$msgstr="恭喜您，会员注册成功。<script>setTimeout(function(){window.location.href=\"login.php\";},2000);</script>";
		$msglink = "<a href='login.php'><u>点击立即登录</u> <img src=\"images/ico_go.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";
	break;

	case "signup_succeed_1":
		$msgstr="恭喜您，会员注册成功。<br />您的账户需要经过管理员审核才能正常使用。<script>setTimeout(function(){window.location.href=\"login.php\";},5000);</script>";
		$msglink = $msglink2;
	break;

	case "signup_succeed_2":
		$msgstr="恭喜您，会员注册成功。<br />系统将会发送一封激活邮件到您的注册邮箱，请注意查收。<script>setTimeout(function(){window.location.href=\"login.php\";},8000);</script>";
		$msglink = $msglink2;
	break;

	case "signup_userexist":
		$msgstr="用户名已经被注册了，请选择其他用户名。";
		$msglink = $msglink1;
	break;

	case "signup_usernotvalid":
		$msgstr="用户名非法，请检查后再试。";
		$msglink = $msglink1;
	break;
	
	case "signup_userlength":
		$msgstr="用户名长度必须为4-24，请检查后再试。";
		$msglink = $msglink1;
	break;
	
	case "signup_reservedkeyword":
		$msgstr="用户名包含非法关键字，请修改后再试。";
		$msglink = $msglink1;
	break;

	case "signup_passlength":
		$msgstr="密码长度必须为6-16，请检查后再试。";
		$msglink = $msglink1;
	break;
	
	case "signup_repasserr":
		$msgstr="重复密码不匹配，请检查后再试。";
		$msglink = $msglink1;
	break;

	
	case "signup_emailnotvalid":
		$msgstr="邮箱格式错误，请检查后再试。";
		$msglink = $msglink1;
	break;

	case "signup_emailexist":
		$msgstr="您填写的邮箱已经被使用了，请修改后再试。";
		$msglink = $msglink1;
	break;
	
	case "signup_validationcodeerr":
		$msgstr="您输入的验证码错误，请检查后重试。";
		$msglink = $msglink1;		
	break;

	case "view_topicnoexist":
		$msgstr="您浏览的帖子不存在。";
		$msglink = $msglink2;		
	break;
	
	case "view_topicnoverify":
		$msgstr="您浏览的帖子还没有通过审核。";
		$msglink = $msglink2;			
	break;

	case "public_active_err":
		$msgstr="对不起，该激活链接不正确，或者已经过期。<br />如果您需要系统重新发送激活邮件，请点击下面的链接。";
		$msglink = "<a href='public.php?action=getactive'><u>发送激活邮件</u> <img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";	
	break;

	case "public_active_succeed":
		$msgstr="恭喜您，用户激活成功。";
		$msglink = "<a href='login.php'><u>点击立即登录</u> <img src=\"images/ico_go.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";
	break;

	case "public_resetpass_err":
		$msgstr="对不起，该重置密码的链接不正确，或者已经过期。<br />如果您需要系统重新发送重置密码的邮件，请点击下面的链接。";
		$msglink = "<a href='public.php?action=forgetpass'><u>发送重置密码邮件</u> <img src=\"images/ico_msgp1.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";	
	break;

	case "public_resetpass_succeed":
		global $newpass;
		$msgstr="恭喜您，密码重置成功。您的新密码是<span class='msg_newpass'>{$newpass}</span>。<br />为了保障账户安全，请登录后立即修改密码。";
		$msglink = "<a href='login.php'><u>点击立即登录</u> <img src=\"images/ico_go.gif\" border=\"0\" align=\"absmiddle\" alt=\"\" /></a>";
	break;

	case "post_succeed":
		$msgstr="您在版块({$cache_forums[$fid]['forumname']})的帖子发布成功。<br />";
		$msglink = $msglink3."<br />".str_replace("{text}","查看发布成功的帖子",$msglink5);
	break;
	
	case "post_required":
		$msgstr="对不起，请填写完整帖子的内容。";
		$msglink = $msglink1;		
	break;
	
	case "post_title_required":
		$msgstr="对不起，请填写完整帖子的标题。";
		$msglink = $msglink1;		
	break;
	
	case "post_notopic":
		$msgstr="帖子不存在。";
		$msglink = $msglink3;		
	break;
	
	case "post_nopost":
		$msgstr="帖子不存在。";
		$msglink = $msglink3;		
	break;
	
	case "post_islock":
		$msgstr="对不起，该帖子已经被锁定。";
		$msglink = $msglink4;		
	break;
	
	case "post_replysucceed":
		$msgstr="您成功回复了帖子。";
		$msglink = $msglink3."<br />".str_replace("{text}","查看回复成功的帖子",$msglink5);
	break;
	
	case "post_ownererr":
		$msgstr="对不起，您没有权限编辑该帖子。";
		$msglink = $msglink4;	
	break;
	
	case "post_edittopicsucceed":
		$msgstr="您在版块({$cache_forums[$fid]['forumname']})的帖子编辑成功。";
		$msglink = $msglink3."<br />".str_replace("{text}","查看编辑成功的帖子",$msglink5);
	break;
	
	case "post_editreplysucceed":
		$msgstr="帖子编辑成功。";
		$msglink = $msglink4;		
	break;

	case "system_noforum":
		$msgstr="您访问的版块不存在。";
		$msglink = $msglink2;			
	break;
	
	case "user_noexist":
		$msgstr="您查看的用户不存在。";
		$msglink = $msglink2;		
	break;	
}

if($msgstr==""){
	$msgstr=$msg_code;
}
require_once('header.php');
require_once getTemplatePath('msg.htm');
footer();
?>